<template>
  <div class="sideCard">
    <p class="title">{{ type === 2 ? '热门面经' : '热门题型' }}</p>
    <ul>
      <li
        v-for="item in hotList"
        :key="item.title"
        class="hotQuestions"
        @click="go(item)"
      >
        <span class="itemTime">{{ item.updatedAt }}</span>
        <br />
        <span class="itemText">{{ item.questionTitle }}</span>
      </li>
    </ul>
    <div class="more">更多</div>
  </div>
</template>

<script>
export default {
  name: 'SideCard',
  props: {
    hotList: {
      type: Array
    },
    type: {
      type: Number,
      default: 1
    }
  },
  methods: {
    go(item) {
      this.$emit('goHotDetail', item)
    }
  }
}
</script>

<style lang="scss" scoped>
.sideCard {
  height: 400px;
  width: 250px;
  background-color: #fff;
  padding: 22px 10px 22px 0;
  .title {
    font-size: 16px;
    border-left: 4px solid #00aae6;
    padding-left: 20px;
  }
  .hotQuestions {
    margin-top: 10px;
    cursor: pointer;
    .itemTime {
      margin-left: 20px;
      font-size: 12px;
      color: #ccc;
      letter-spacing: 1px;
    }
    .itemText {
      display: inline-block;
      font-size: 14px;
      margin-left: 20px;
      margin-top: 4px;
    }
    &:hover {
      color: #00aae6;
      transition: color 0.5s;
      .itemTime {
        color: #00aae6;
        transition: color 0.5s;
      }
    }
  }
  .more {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #ccd;
    cursor: pointer;
  }
}
</style>